package com.qijian.maindata.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.qijian.maindata.domain.ProcessPerformance;
import com.qijian.maindata.domain.query.ProcessPerformanceQuery;
import com.qijian.maindata.domain.vo.*;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 工艺绩效Mapper接口
 *
 * @author qijian
 * @date 2022-05-17
 */
public interface ProcessPerformanceMapper extends BaseMapper<ProcessPerformance> {

    @Select("select count(0) from main_process_performance WHERE create_time >= CURRENT_DATE ")
    int countCurrentDateWithDel();

    List<ProcessPerformanceVo> sumProcessEarn(@Param("query") ProcessPerformanceQuery query, @Param("isAll") Boolean isAll);

    List<ProcessPerformanceVo> sumProcessEarnDetails(@Param("userId") Long userId, @Param("year") String year, @Param("nickName") String nickName,@Param("day") String day);

    List<ProcessPerformanceExcelVo> getListByUserId(@Param(Constants.WRAPPER) QueryWrapper<ProcessPerformanceQuery> queryWrapper);

    List<BomExportVo> selectBomAndNcList(@Param("query") ProcessPerformanceQuery query);

    List<ProcessPlanVo> selectProcessPlanList(@Param("query") ProcessPerformanceQuery query);

    List<ProcessPerformanceExportVo> selectProcessPerformanceList(@Param("query") ProcessPerformanceQuery query);
}
